import QtQuick 2.0

Circle {//继承自Circle
    id:sender
    property int count: 0 //属性
    signal send(string value)
    property Receiver target: null
    onTargetChanged: {
        //当目标发生改变，连接到receive槽函数
        send.connect(target.receive)
    }

    MouseArea{
        anchors.fill: parent //使点击效果生效

        onClicked: {
            sender.count++
            sender.send(count)
        }

        onPressed: {
            sender.circleColor = "blue"
        }

        onReleased: {
            sender.circleColor = "red"
        }
    }

}
